﻿using System;
using System.Data;
public class SourceAnhChay
{
    
	public SourceAnhChay()
	{
        
	}
    public static string SlideAnh()
    {
        Data data = new Data();
        DataTable tableAnhChay = data.GetTable_By_Name("AnhChay");
        string[] TopAnhChayImage = new string[5];
        string[] TopAnhChayLink = new string[5];
        string[] TopAnhChayTieuDe = new string[5];
        string[] TopAnhChayTieuDeTomTat = new string[5];
        for (int i = 0; i < tableAnhChay.Rows.Count; i++)
        {
            TopAnhChayImage[i] = tableAnhChay.Rows[i]["AnhChayImage"].ToString();
            TopAnhChayLink[i] = tableAnhChay.Rows[i]["AnhChayLink"].ToString();
            TopAnhChayTieuDe[i] = tableAnhChay.Rows[i]["AnhChayTieuDe"].ToString();
            TopAnhChayTieuDeTomTat[i] = tableAnhChay.Rows[i]["AnhChayTieuDeTomTat"].ToString();
        }
        string result = "<UL>"+
                          "<LI>"+
                            "<A href='"+TopAnhChayLink[0]+"'>"+
                                "<IMG height=343 alt='" + TopAnhChayTieuDeTomTat[0] + "' src='Images/AnhChay/" + TopAnhChayImage[0] + "' width=700 />" +
                            "</A> "+
                          "</LI>"+
                         "<LI>"+
                            "<A href='" + TopAnhChayLink[1] + "'>" +
                                "<IMG height=343 alt='" + TopAnhChayTieuDeTomTat[1] + "' src='Images/AnhChay/" + TopAnhChayImage[1] + "' width=700 />" +
                            "</A> "+
                          "</LI>"+
                           "<LI>"+
                            "<A href='" + TopAnhChayLink[2] + "'>" +
                                "<IMG height=343 alt='" + TopAnhChayTieuDeTomTat[2] + "' src='Images/AnhChay/" + TopAnhChayImage[2] + "' width=700 />" +
                            "</A> "+
                          "</LI>"+
                           "<LI>"+
                            "<A href='" + TopAnhChayLink[3] + "'>" +
                                "<IMG height=343 alt='" + TopAnhChayTieuDeTomTat[3] + "' src='Images/AnhChay/" + TopAnhChayImage[3] + "' width=700 />" +
                            "</A> "+
                          "</LI>"+
                           "<LI>"+
                            "<A href='" + TopAnhChayLink[4] + "'>" +
                                "<IMG height=343 alt='" + TopAnhChayTieuDeTomTat[4] + "' src='Images/AnhChay/" + TopAnhChayImage[4] + "' width=700 />" +
                            "</A> "+
                          "</LI>"+
                        "<UL class=webwidget_slideshow_simple_nav>"+
                          "<LI><A href='" + TopAnhChayLink[0] + "'>1</A> </LI>" +
                          "<LI><A href='" + TopAnhChayLink[1] + "'>2</A> </LI>" +
                          "<LI><A href='" + TopAnhChayLink[2] + "'>3</A> </LI>" +
                          "<LI><A href='" + TopAnhChayLink[3] + "'>4</A> </LI>" +
                          "<LI><A href='" + TopAnhChayLink[4] + "'>5</A> </LI>" +
                        "</UL>";
        
        return result;
    }
    public static string SlideAnhChild()
    {
        Data data = new Data();
        DataTable tableAnhChay = data.GetTable_By_Name("AnhChay");
        string[] TopAnhChayImage = new string[5];
        string[] TopAnhChayLink = new string[5];
        string[] TopAnhChayTieuDe = new string[5];
        string[] TopAnhChayTieuDeTomTat = new string[5];
        for (int i = 0; i < tableAnhChay.Rows.Count; i++)
        {
            TopAnhChayImage[i] = tableAnhChay.Rows[i]["AnhChayImage"].ToString();
            TopAnhChayLink[i] = tableAnhChay.Rows[i]["AnhChayLink"].ToString();
            TopAnhChayTieuDe[i] = tableAnhChay.Rows[i]["AnhChayTieuDe"].ToString();
            TopAnhChayTieuDeTomTat[i] = tableAnhChay.Rows[i]["AnhChayTieuDeTomTat"].ToString();
        }
        string result = "<UL>" +
                          "<LI>" +
                            "<A href='" + TopAnhChayLink[0] + "'>" +
                                "<IMG height=343 alt='" + TopAnhChayTieuDeTomTat[0] + "' src='../Images/AnhChay/" + TopAnhChayImage[0] + "' width=700 />" +
                            "</A> " +
                          "</LI>" +
                         "<LI>" +
                            "<A href='" + TopAnhChayLink[1] + "'>" +
                                "<IMG height=343 alt='" + TopAnhChayTieuDeTomTat[1] + "' src='../Images/AnhChay/" + TopAnhChayImage[1] + "' width=700 />" +
                            "</A> " +
                          "</LI>" +
                           "<LI>" +
                            "<A href='" + TopAnhChayLink[2] + "'>" +
                                "<IMG height=343 alt='" + TopAnhChayTieuDeTomTat[2] + "' src='../Images/AnhChay/" + TopAnhChayImage[2] + "' width=700 />" +
                            "</A> " +
                          "</LI>" +
                           "<LI>" +
                            "<A href='" + TopAnhChayLink[3] + "'>" +
                                "<IMG height=343 alt='" + TopAnhChayTieuDeTomTat[3] + "' src='../Images/AnhChay/" + TopAnhChayImage[3] + "' width=700 />" +
                            "</A> " +
                          "</LI>" +
                           "<LI>" +
                            "<A href='" + TopAnhChayLink[4] + "'>" +
                                "<IMG height=343 alt='" + TopAnhChayTieuDeTomTat[4] + "' src='../Images/AnhChay/" + TopAnhChayImage[4] + "' width=700 />" +
                            "</A> " +
                          "</LI>" +
                        "<UL class='webwidget_slideshow_simple_nav'>" +
                          "<LI><A href='" + TopAnhChayLink[0] + "'>1</A> </LI>" +
                          "<LI><A href='" + TopAnhChayLink[1] + "'>2</A> </LI>" +
                          "<LI><A href='" + TopAnhChayLink[2] + "'>3</A> </LI>" +
                          "<LI><A href='" + TopAnhChayLink[3] + "'>4</A> </LI>" +
                          "<LI><A href='" + TopAnhChayLink[4] + "'>5</A> </LI>" +
                        "</UL>";

        return result;
    }
    public static string Slide5anh()
    {
        string result = "";
        Data data = new Data();
        DataTable tableAnhChay = new DataTable();
        tableAnhChay = data.GetTable_By_Name("Slide5anh");
        string[] TopAnhChayImage = new string[tableAnhChay.Rows.Count];
        string[] TopAnhChayLink = new string[tableAnhChay.Rows.Count];
        string[] TopAnhChayTieuDe = new string[tableAnhChay.Rows.Count];
        string[] TopAnhChayTieuDeTomTat = new string[tableAnhChay.Rows.Count];
        for (int i = 0; i < tableAnhChay.Rows.Count; i++)
        {
            TopAnhChayImage[i] = tableAnhChay.Rows[i]["AnhChayImage"].ToString();
            TopAnhChayLink[i] = tableAnhChay.Rows[i]["AnhChayLink"].ToString();
            TopAnhChayTieuDe[i] = tableAnhChay.Rows[i]["AnhChayTieuDe"].ToString();
            TopAnhChayTieuDeTomTat[i] = tableAnhChay.Rows[i]["AnhChayTieuDeTomTat"].ToString();
            //result += "<div style='float:left;padding-left:20px' ><a href='"+TopAnhChayLink[i]+"' ><img src='Images/AnhChay/" + TopAnhChayImage[i] + "' style='border:1px;border-style:solid;border-color:Silver;padding:3px;width: 100px;margin-left: 5px;margin-right: 5px;margin-top: 5px;margin-bottom: 5px;float: left;vertical-align: top;height:80px'></a></div>";
            result += "<li style='margin-right:20px; width:120px'><a href='" + TopAnhChayLink[i] + "'><img src='Images/Slide5anh/" + TopAnhChayImage[i] + "' style='height:80px;width:100px' ></a></li>";
        }
        return result;
    }
    public static string Slide5anhChild()
    {
        string result = "";
        Data data = new Data();
        DataTable tableAnhChay = new DataTable();
        tableAnhChay = data.GetTable_By_Name("Slide5anh");
        string[] TopAnhChayImage = new string[tableAnhChay.Rows.Count];
        string[] TopAnhChayLink = new string[tableAnhChay.Rows.Count];
        string[] TopAnhChayTieuDe = new string[tableAnhChay.Rows.Count];
        string[] TopAnhChayTieuDeTomTat = new string[tableAnhChay.Rows.Count];
        for (int i = 0; i < tableAnhChay.Rows.Count; i++)
        {
            TopAnhChayImage[i] = tableAnhChay.Rows[i]["AnhChayImage"].ToString();
            TopAnhChayLink[i] = tableAnhChay.Rows[i]["AnhChayLink"].ToString();
            TopAnhChayTieuDe[i] = tableAnhChay.Rows[i]["AnhChayTieuDe"].ToString();
            TopAnhChayTieuDeTomTat[i] = tableAnhChay.Rows[i]["AnhChayTieuDeTomTat"].ToString();
            result += "<li style='margin-right:20px; width:120px'><a href='" + TopAnhChayLink[i] + "'><img src='../Images/Slide5anh/" + TopAnhChayImage[i] + "' style='height:80px;width:100px' ></a></li>";
        }
        return result;
    }
    //public static string Source()
    //{
    //    Data data = new Data();
    //    DataTable table = data.GetTable_By_Name("AnhChay");
    //    string[] TopAnhChayImage = new string[5];
    //    string[] TopAnhChayLink = new string[5];
    //    string[] TopAnhChayTieuDe = new string[5];
    //    string[] TopAnhChayTieuDeTomTat = new string[5];
    //    for (int i = 0; i < table.Rows.Count; i++)
    //    {
    //        TopAnhChayImage[i] = table.Rows[i]["AnhChayImage"].ToString();
    //        TopAnhChayLink[i] = table.Rows[i]["AnhChayLink"].ToString();
    //        TopAnhChayTieuDe[i] = table.Rows[i]["AnhChayTieuDe"].ToString();
    //        TopAnhChayTieuDeTomTat[i] = table.Rows[i]["AnhChayTieuDeTomTat"].ToString();
    //    }
    //    return "<div class=topArticle>" +
    //      "<UL class=bd>" +
    //      "<LI style='DISPLAY: block' id=_Top_Article_100393 class=tabcontent>" +

    //      "<A href='" + TopAnhChayLink [0]+ "'>" +
    //      "<IMG border=0 hspace=0 vspace=0 align=left src='Images/AnhChay/" + TopAnhChayImage [0]+ "' width=420></A>" +
    //      "<A class=des href='" + TopAnhChayLink[0] + "'>" +
    //      "<p class=tit>" + TopAnhChayTieuDe[0] + "</p>" +
    //      "<p>" + TopAnhChayTieuDeTomTat[0] + "</p></A>" +
    //      "<A class=mask></A>" +
    //      "<LI id=_Top_Article_100391 class=tabcontent>" +

    //      "<A href='" + TopAnhChayLink[1] + "'>" +
    //      "<IMG border=0 hspace=0 vspace=0 align=left src='Images/AnhChay/" + TopAnhChayImage[1] + "' width=420></A>" +
    //      "<A class=des href='" + TopAnhChayLink[1] + "'>" +
    //      "<p class=tit>" + TopAnhChayTieuDe[1] + "</p>" +
    //      "<p >" + TopAnhChayTieuDeTomTat[1] + "</p></A>" +
    //      "<A class=mask></A>" +
    //      "<LI id=_Top_Article_100371 class=tabcontent>" +

    //      "<A href='" + TopAnhChayLink[2] + "'>" +
    //      "<IMG border=0 hspace=0 vspace=0 align=left src='Images/AnhChay/" + TopAnhChayImage[2] + "' width=420></A>" +
    //      "<A class=des href='" + TopAnhChayLink[2] + "'>" +
    //      "<p class=tit>" + TopAnhChayTieuDe[2] + "</p>" +
    //      "<p style='TEXT-ALIGN: justify'>" + TopAnhChayTieuDeTomTat[2] + "</p></A>" +
    //      "<A class=mask></A>" +
    //      "<LI id=_Top_Article_100364 class=tabcontent>" +

    //      "<A href='" + TopAnhChayLink[3] + "'>" +
    //      "<IMG border=0 hspace=0 vspace=0 align=left src='Images/AnhChay/" + TopAnhChayImage[3] + "' width=420></A>" +
    //      "<A class=des href='" + TopAnhChayLink[3] + "'>" +
    //      "<p class=tit>" + TopAnhChayTieuDe[3] + "</p>" +
    //      "<p>" + TopAnhChayTieuDeTomTat[3] + "</p></A>" +
    //      "<A class=mask></A>" +
    //      "<LI id=_Top_Article_100377 class=tabcontent>" +

    //      "<A href='" + TopAnhChayLink[4] + "'>" +
    //      "<IMG border=0 hspace=0 vspace=0 align=left src='Images/AnhChay/" + TopAnhChayImage[4] + "' width=420></A>" +
    //      "<A class=des href='" + TopAnhChayLink[4] + "'>" +
    //      "<p class=tit>" + TopAnhChayTieuDe[4] + "</p>" +
    //      "<p>" + TopAnhChayTieuDeTomTat[4] + "</p></A><A class=mask></A></LI></UL>" +

    //      "<UL id=article_Nav class=hd>" +
    //      "<LI>" +
    //      "<A href='" + TopAnhChayLink[0] + "' rel=_Top_Article_100393>" +
    //      "<span class=arrow></span>" +
    //      "<IMG border=0 hspace=5 vspace=5 align=left src='Images/AnhChay/" + TopAnhChayImage[0] + "' width=50 height=50>" + TopAnhChayTieuDe[0] + "</A>" +
    //      "<LI>" +
    //      "<A href='" + TopAnhChayLink[1] + "' rel=_Top_Article_100391>" +
    //      "<span class=arrow></span>" +
    //      "<IMG border=0 hspace=5 vspace=5 align=left src='Images/AnhChay/" + TopAnhChayImage[1] + "' width=50 height=50>" + TopAnhChayTieuDe[1] + "</A>" +
    //      "<LI>" +
    //      "<A href='" + TopAnhChayLink[2] + "' rel=_Top_Article_100371>" +
    //      "<span class=arrow></span>" +
    //      "<IMG border=0 hspace=5 vspace=5 align=left src='Images/AnhChay/" + TopAnhChayImage[2] + "' width=50 height=50>" + TopAnhChayTieuDe[2] + "</A>" +
    //      "<LI>" +
    //      "<A href='" + TopAnhChayLink[3] + "' rel=_Top_Article_100364>" +
    //      "<span class=arrow></span>" +
    //      "<IMG border=0 hspace=5 vspace=5 align=left src='Images/AnhChay/" + TopAnhChayImage[3] + "' width=50 height=50>" + TopAnhChayTieuDe[3] + "</A>" +
    //      "<LI>" +
    //      "<A href='" + TopAnhChayLink[4] + "' rel=_Top_Article_100377>" +
    //      "<span class=arrow></span>" +
    //      "<IMG border=0 hspace=5 vspace=5 align=left src='Images/AnhChay/" + TopAnhChayImage[4] + "' width=50 height=50>" + TopAnhChayTieuDe[4] + "</A></LI></UL></div>";

    //}
}
